 <?php
 $monhoc = $this->common_model->getdata('subjects',array('publish'=>1),array('id','title'),array('order','ASC'));
?>
  <script>
  $(document).ready(function() {
    var availableTags1 = [<?php  if(!empty($monhoc)){
        $i=0;
        $n=count($monhoc);
        foreach($monhoc as $mon){
            if($i==$n){
                echo '"'.$mon->title.'"';
            }else{
                echo '"'.$mon->title.'",';
            }
            $i++;
        }
    }?>
	];
    $( "#subjects_input" ).autocomplete({
      source: availableTags1,disabled: false,autoFocus:true,widget:true,delay:0
    });
  });
  </script>
<section id="main_search">
		<div class="wrap_search">
			<p class="text_top">10+ Giúp giáo viên và học sinh kết nối dễ dàng hơn</p>
			<p class="text_top3">
				<a href="yeu-cau-gia-su.html">Yêu cầu gia sư</a> trong trường hợp bạn chưa tìm được người phù hợp.
			</p>
			<!-- /.text_top -->
            <form action="<?php echo base_url().'tim-kiem.html'; ?>" method="POST">
                <div class="dov">
    			<ul class="main_search clearfix">
                    <li><input name="search" id="subjects_input" value="" placeholder="Bạn cần tìm gia sư môn học gì" name="keyword" style="-webkit-border-radius: 5px 0 0 5px;-moz-border-radius: 5px 0 0 5px;border-radius: 5px 0 0 5px;margin: -20px 0px;z-index:9999" />
                            <?php if(!empty($tinh)) { ?>
                            <select name="province" style="height:49px;-webkit-border-radius: 0;-moz-border-radius: 0;border-radius: 0;z-index:1;margin-left:-4px">
                                <?php foreach ( $tinh as $q )
                                echo '
                                <option value="'.$q->id.'">-- '.$q->title.' --</option>';
                                 ?>
                            </select>
                            <?php } ?>
                    <input type="submit" value="Tìm kiếm" class="btn_search" style="-webkit-border-radius: 0 5px 5px 0;-moz-border-radius: 0 5px 5px 0;border-radius: 0 5px 5px 0;margin-left:-3px" /></li>
                </ul>
                </div>
            </form>
		</div>
		<!-- /.wrap_search -->
</section>
<!-- /#main_search -->
<?php if(!empty($menu_monhoc)) { echo $menu_monhoc; } ?>
<?php if(!empty($hightlight)) { ?>
	<div id="carousel" class="simple-ul">
		<div class="container">
			<div class="row">
				<div class="span12">
					<div id="carousel-scroll-container">
						<div class="viewport">
							<ul style="left: -40px;" id="carousel-list" class="overview">
							<?php 
								foreach ($hightlight as $k => $a) :
									$image = explode(',',$users[$k]->avartar); 
							?>
								<li>
									<a id="Calculus-help" href="<?php echo base_url().'thong-tin-gia-su.'.$users[$k]->id.'.html'; ?>" >
									<span style="background-image: url(&quot;<?php echo get_thumnails($image[0],160,160); ?>&quot;);" class="expert-img" data-url="<?php echo get_thumnails($image[0],160,160); ?>">
									<!--span class="expert-bio"><strong></strong></span-->
									</span>
									<span class="subject"><?php echo $users[$k]->name;?></span>
									<span class="experts"><?php  echo $this->common_model->getnumber2('rating_star',array('tutorid'=>$users[$k]->id));?> Đánh giá
									</span>
									</a>
								</li>
							<?php endforeach; ?>
							</ul>
						</div>
						<div style="width: 940px;" class="scrollbar">
							<div style="width: 940px;" class="track">
								<div id="carousel-scrollbar" class="thumb"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- /#row3 -->
    <?php } ?>
        <?php if(!empty($intro)) : ?>
	<div class="row4">
		<div class="wrapper clearfix">
			<section class="row4_left">
				<p class="row4_left_hd"><?php echo $numstudent; ?> học sinh đã tìm được gia sư tại 10+ !</p>
				<p class="node_text">Rất tiện dụng và đơn giản ! Tìm kiếm gia sư cho bạn ngay hôm nay.</p>
				<a href="<?php echo base_url(); ?>tim-gia-su.html" title="Tìm gia sư" class="searh_btn">Tìm kiếm gia sư</a>
			</section>
			<!-- /.row4_left -->
			<section class="row4_right">
				<h3 class="row4_right_hd">
					Tìm gia sư chỉ trong 4 bước tìm kiếm
				</h3>
				<!-- /.row4_right_hd -->
				<ul class="item_right-row4">
                <?php $j=1; foreach ($intro as $i) :?>
					<li class="r4_item">
						<?php echo '<span class="ol-number">'.$j.'</span><span class="cl_r4">'; echo $i->title; ?></span><br />
						
                            <?php echo $i->description; ?>
                        
						<!-- /.intro_r4 -->
					</li>
                 <?php $j++; endforeach; ?>
				</ul>
				<!-- /.item_right-row4 -->
			</section>
			<!-- /.row4_right -->
		</div>
		<!-- /.wrapper -->
	</div>
	<!-- /.row4 -->
<?php endif; ?>
	<div class="row5 clearfix">
		<div class="wrapper">
		<section class="left_r5">
			<div class="item_r5_left">
            <?php if(!empty($reviews_student)) { ?>
				<div class="r51">
					<h3 class="heading_r51">Học sinh nói gì về 10 + ?</h3>
					<!-- /.heading_r51 -->
					<ul class="slide_r5 clearfix">
                        <?php foreach($reviews_student as $rv1) : 
                        $account = $this->common_model->getone('users',array('id'=>$rv1->userid)); ?>
						<li class="clearfix">
							<h4 class="heading_slide"><?php if(!empty($account)) {echo $account->name;} ?></h4>
                            <h6 style="color: #fff;font-size:11px;font-style:italic;font-weigth:normal"><?php if(!empty($account)) {echo $account->address;} ?></h6>
							<div class="intro_slide"><i class="icon-quote-left icon-1x"></i><?php $noidung=strip_tags($rv1->content,'1<a><b><i><u><img><br>'); echo character_limiter($noidung,220);;   ?><i class="icon-quote-right icon-1x"></i></div>
						</li>
                        <?php endforeach; ?>
					</ul>
					<p class="bottom_slide">&nbsp;</p>
				</div>
            <?php } ?>
            <?php if($reviews_tutor) { ?>
				<div class="r51">
					<h3 class="heading_r51">Gia sư nói gì về 10 + ?</h3>
					<!-- /.heading_r51 -->
					<ul class="slide_r5 clearfix">
                        <?php foreach($reviews_tutor as $rv2) : 
                        $account2 = $this->common_model->getone('users',array('id'=>$rv2->userid)); ?>
						<li>
							<h4 class="heading_slide"><?php if(!empty($account2)) {echo $account2->name;} ?></h4>
							<h6 style="color: #fff;font-size:11px;font-style:italic;font-weigth:normal"><?php if(!empty($account2)) {echo $account2->address;} ?></h6>
                            <div class="intro_slide"><i class="icon-quote-left icon-1x"></i><?php $noidung2=strip_tags($rv2->content,'<a><b><i><u><img><br>'); echo character_limiter($noidung2,220);;   ?><i class="icon-quote-right icon-1x"></i></div>
						</li>
                        <?php endforeach; ?>
					</ul>
					<p class="bottom_slide">&nbsp;</p>
				</div>
				<!-- /.r51 -->
                 <?php } ?>
			</div>
			<!-- /.item_r5_left -->
		</section>
		<!-- /.left_r5 -->
		<section class="right_r5">
				<h2 class="heading_r5">Kết nối học sinh và gia sư hiệu quả nhất.<?php if($this->session->userdata('id') == 1) { echo '<a href="#" style="color:red;" data-table="abcd" data-colunm="" class="edit-data" title="Chỉnh sửa">Edit</a>'; } ?></h2>
				<!-- /.heading_r5 -->
				<p class="node_text">98% các học sinh đã tìm thấy gia sư ưng ý với mình tại 10+. Còn bạn thì sao ? Hãy thử tìm ngay một gia sư theo ý mình<?php if($this->session->userdata('id') == 1) { echo '<a href="#" data-table="" data-colunm="" style="color:red;" title="Chỉnh sửa">Edit</a>'; } ?></p>
				<!-- /.node_text -->
				<a href="<?php echo base_url(); ?>y-kien.html" title="Tìm gia sư" class="searh_btn">Ý kiến người dùng</a>
                <script>
                    $(document).ready(function(){
                       $('.edit-data').click(function(){
                            var table = $(this).attr('data-table');
                            alert(table);
                       });
                    });
                </script>
		</section>
		<!-- /.right_r5 -->
	</div>
	</div>
	<!-- /.row5 -->
    <?php if($reviews_tutor) { ?>
	<div class="row6">
		<div class="wrapper clearfix">
			<section class="row6_left">
				<h2 class="row6_left_hd">Bạn đã sẵn sàng trở thành một gia sư ?
				</h2>
				<!-- /.heading_r6 -->
				<p class="node_text">Đừng ngần ngại! Hãy tham gia cộng đồng 10+ ngay hôm nay !</p>
				<!-- /.node_text -->
				<a class="searh_btn" rel="leanModal" id="register_form" href="#register">Đăng kí ngay hôm nay</a>
				
			</section>
			<!-- /.r6_left -->
			<section class="r6_slide">
				<ul class="main_slide_r6 clearfix">
                    <?php foreach( $reviews_tutor as $rv3) :
                    $account3 = $this->common_model->getone('users',array('id'=>$rv3->userid));
                    if(!empty($account3->avartar))
                    {
                        $img = explode(',',$account3->avartar);
                        $avartar = $img[0];
                    }
                    else
                    {
                        $avartar = base_url().'skin/front-end/images/logo.png';
                    }
                      ?>
					<li class="list_r6 clearfix">
						<h3 class="heading_r6"><?php $rv3->title; ?> </h3>
						<p class="intro_r6">
                            <?php if(!empty($account3)){echo $account3->name;}?>:<br />
							<i class="icon-quote-left icon-1x"></i><?php  $noidung3=strip_tags($rv3->content,'<a><b><i><u><img><br>'); if(!empty($noidung3)){echo character_limiter($noidung3,500); }  ?><i class="icon-quote-right icon-1x"></i>
						</p>
						<!-- /.intro_r6 -->
						<div class="info_r6">
							<h4 class="thumnails_r6">
								<img src="<?php if(!empty($avartar)) {echo get_thumnails($avartar);}?>" alt="<?php if(!empty($account3->name)){ echo $account3->name;} ?>" />
							</h4>
							<p class="name_r6">
								<?php if(!empty($account3->address)){ echo $account3->address;}  ?>
							</p>
						</div>
						<!-- /.info_r6 -->
					</li>
                    <?php endforeach; ?>
				</ul>
				<!-- /.main_slide_r6 -->
				<p class="bottom_row6">&nbsp;</p>
			</section>
			<!-- /.r6_slide -->
		</div>
		<!-- /.wrapper -->
	</div>
	<!-- /.row6 -->
    <?php } ?>
	<div class="row7">
		<section class="wrapper">
			<div class="top_r7">
				<h2 class="heading_r7">Nếu bạn cần giúp đỡ? Hãy gọi ngay cho chúng tôi</h2>
				<p class="node_r7">Hãy gọi <?php echo $setting->phone ?> hoặc email <?php echo $setting->email ?></p>
				<!-- /.heading_r7 -->
				<a href="<?php echo base_url().'gioi-thieu.html'; ?>" title="" class="searh_btn">Xem thêm về 10+</a>
			</div>
			<!-- /.top_r7 -->
		</section>
		<!-- /.wrapper -->
	</div>
	<!-- /.row7 -->
 <script src="<?php echo base_url() ?>skin/front-end/js/jquery.bxslider.min.js"></script>
 <script>
 $(document).ready(function(){
    $('.main_slide_r6').bxSlider({
        auto:true
    });
    $('.slide_r5').bxSlider({
        auto:true
    });
    $('.slide_hl').bxSlider({
        auto:true,
		minSlides: 5,
		maxSlides: 5,
		slideWidth: 800,
    });
 })
 </script>
 <style>
 .main_slide_r6,.r6_slide
 {
    position:relative;
 }
 .bx-pager
 {
    display:none;
 }
 .bx-controls-direction .bx-next,.bx-controls-direction .bx-prev
 {
    position:absolute;
    top:48%;
    text-indent: -9999px;
    width:20px;
    height:26px;
 }
 .bx-controls-direction .bx-next
 {
    right:0px;
    background:url("<?php echo base_url().'skin/front-end/images/slider-arrow-right.png' ?>");
 }
  .bx-controls-direction .bx-prev
 {
    left:0px;
    background:url("<?php echo base_url().'skin/front-end/images/slider-arrow-left.png' ?>");
 }
 .slide_r5
 {

 }
  .slide_r5 li
  {
        height:150px;
        padding:0 15px 15px 15px;
        margin:5px 0
  }
 </style>
 	<script>
		var muoicongConfig = {},
		    updateConfig = function(options) {
		        options = options || {};
		        for (var k in options) {
		            if (options.hasOwnProperty(k)) {
		                window[k] = muoicongConfig[k] = options[k];
		            }
		        }
		    };
		
		updateConfig({
		    update: updateConfig,
		});
		function jsLoadFail() {
		    var reason = 'unknown';
		    if (!window.jQuery) {
		        reason = 'jquery';
		    } else if (!window.resourcesLoaded) {
		        reason = 'resources';
		    }
		
		    ratchetConsoleLog('JS LOAD FAIL: ' + reason);
		    showErrorCatchall('#error-js-fail');
		}
	</script>
	<script>
		var hasCarousel = true;
		var context = 'on_demand';
	</script>
	<script>
		function jsOnload() {
		    if (window.resourcesLoaded) {
		        afterLoad();
				loadIndex();
		    } else {
		        jsLoadFail();
		    }
		};
		function loadJs() {
		    $.ajax({
		        url: '<?php echo base_url();?>skin/front-end/js/08414f2c10.js',
		        dataType: 'script',
		        cache: true,
		        success: jsOnload,
		        error: jsLoadFail
		    });
		}
		
		if (window.jQuery) {
		    $(document).ready(loadJs);
		} else {
		    jsLoadFail();
		}
	</script>
	<script>
		function afterLoad() {
		    require(['page-all'], function(all) {
		        all.$storage.ready();
		    });
		}
	</script>